package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/1
 */
public class ApprovalTest {
    public static void main(String[] args) {
        // 创建审批链
        Approver director = new Director("张主任");
        Approver manager = new DeptManager("李经理");
        Approver deputyGM = new DeputyGeneralManager("王副总");
        Approver gm = new GeneralManager("赵总");
        Approver meeting = new MeetingApproval("董事会");

        director.setSuccessor(manager);
        manager.setSuccessor(deputyGM);
        deputyGM.setSuccessor(gm);
        gm.setSuccessor(meeting);

        // 测试不同金额的采购单
        PurchaseRequest request1 = new PurchaseRequest("办公用品", 8000);
        director.handleRequest(request1);

        PurchaseRequest request2 = new PurchaseRequest("设备采购", 45000);
        director.handleRequest(request2);

        PurchaseRequest request3 = new PurchaseRequest("项目材料", 120000);
        director.handleRequest(request3);

        PurchaseRequest request4 = new PurchaseRequest("厂房建设", 2500000);
        director.handleRequest(request4);
    }
}